Ext.define('AmpleHarvest.objects.forms.irtCommon.requestTicketInformation',
{
	extend			: 'Ext.form.FieldSet',
	alias			: 'widget.ampleharvest-objects-forms-irtcommon-requestticketinformation',
	title			: "Ticket Information",
	collapsible		: false,
	labelWidth		: 70,
	width			: 1240,
	boxMinWidth		: 1240,
	m_str_group_ID	: null,
	ticketStatus	: null,
	
	requires		:
	[
			"Ext.form.field.Text", 
			"Ext.form.FieldSet",
			'Ext.layout.container.VBox',
			'Ext.layout.container.HBox',			
	],
	
	listeners       :
    {
    	dataResponse	: function(obj_data)
    	{
    		var importers = Ext.create('Ext.data.Store',
    				{
    					fields	: ['ID', 'UserName'],
    					data	: obj_data.data
    				})
    		var GroupUserDD = Ext.create('Ext.form.field.ComboBox',{
    			fieldLabel		: 'Select Importer',
    			name			: 'importer_sid',
    		    store			: importers,
    		    queryMode		: 'local',
    		    displayField	: 'UserName',
    		    valueField		: 'UserName'
    		});
    		this.add(GroupUserDD);
    	}
    },
    
	initComponent	: function()
	{
		this.ticketStatus = Ext.create('Ext.data.Store',{
			fields: ['statusKey', 'statusValue'],
			data : [
		        {"statusKey":"0", "statusValue":"New"},
		        {"statusKey":"1", "statusValue":"Received"},
		        {"statusKey":"2", "statusValue":"Evaluating"},
		        {"statusKey":"3", "statusValue":"In Progress"},
		        {"statusKey":"4", "statusValue":"Completed"},
		        {"statusKey":"5", "statusValue":"Rejected"},
		        {"statusKey":"6", "statusValue":"On Hold"},
		    ]
		});
		
		this.ticketStatusComboBox = Ext.create('Ext.form.ComboBox', {
			name: 'status', //PHP Column label
		    fieldLabel: 'Set Status',
		    store: this.ticketStatus,
		    queryMode: 'local',
		    displayField: 'statusValue',
		    valueField: 'statusKey',
		    renderTo: Ext.getBody()
		});
		
		this.m_obj_util = Ext.create('AmpleHarvest.util.utility');
		this.m_obj_util.AHcaller = this;
		
		
		this.ticketInformationHbox = Ext.create('Ext.Panel', 
		{ 
			border		: false,
			layout		: 
			{
				type	: 'hbox',
				align	: 'middle'
			}
		});	
		
		this.importerHBox = Ext.create('Ext.form.Panel', 
		{ 
			border: false,
			layout : 
			{
				type	: 'hbox',
				align	: 'middle'
			}
		});	
		
		this.items =
		[
			this.ticketStatusComboBox
		];
		
	    this.callParent();
	    
	    this.m_obj_util.getData('External/rest/usermanager/usersbygroup.php', { ID : this.m_str_group_ID },{},'GET', {}, {});
	}
});